import React from 'react'
import Title from 'component/title'

class App extends React.Component {
  render () {
    const {data = []} = this.props
    if (!data.length) {
      return null
    }
    return (
      <div>
        <Title title='保费详细' step={this.props.step} />

        <div className='premium-head'>
          <span className='item-name fl'>Insurance project</span>
          <span className='item-cost fr'>Insured amount</span>
        </div>
        <div className='protect-list'>
          <ul className='list mb50'>
            {data.map((item, index) => {
              return (
                <li className='item bor-bottom' key={index}>
                  <span className='name ell fl'>
                    {item.name}
                    {item.mian &&
                    <em className='high-light ml5 '>(Deductibles ${T.formatPrice(item.mian)})</em>
                    }
                  </span>
                  <span className='cost fr ell'>{T.formatPrice(item.money)}</span>
                </li>
              )
            })}
          </ul>
        </div>
      </div>

    )
  }
}

export default App
